'''
Created on 09.12.2011

@author: cwestphal
'''

import maya.cmds as cmds

targets = cmds.ls (selection = True) [:-1]
source = cmds.ls (selection = True, tail = True)[0]


for obj in targets:
    sel = [source,obj]
    cmds.select (sel)
    cmds.copySkinWeights (noMirror = True, surfaceAssociation = 'closestPoint', influenceAssociation = 'closestJoint')
    print source + ' SkinWeights copied to ' + obj 
